{% load i18n %}
<script id="temp_order_history" type="text/html">
<table class="table table-hover table-striped gray">
    <thead>
        <tr >
            <th>{% trans '委托时间' %}</th>
            <th>{% trans '交易时间' %}</th>
            <th>{% trans '买入'%} {% trans '卖出' %}</th>
            <th>{% trans '价格' %}(<%=coin1_info.name_upper%>)</th>
            <th>{% trans '数量' %}(<%=coin0_info.name_upper%>)</th>
            <th>{% trans '金额' %}(<%=coin1_info.name_upper%>)</th>
        </tr>
    </thead>
    <tbody>
        <% if (jsonobj.length == 0 ){ %>
        <tr>
            <td colspan="7"><p class="green f-center f-fb">{% trans '暂无委托' %}</p></td>
        </tr>
        <% } %>
        <% for(i = 0; i < jsonobj.length; i ++ ){ %>
        <%  var info = jsonobj[i] %>
        <%  var create_time = $imports.data_format(info.create_time); %>
        <%  var finish_time = $imports.data_format(info.finish_time); %>
        <%  var count = info.count * 1 %>
        <%  var amount = info.price * count%>
        <%  var amount = amount.toFixed(4)%>
        <%  var price = info.price *1%>
        <%  var order_type = "{% trans '限价买入'%}"%>
        <%  var class_color = "green"%>
        <%  if (info.order_type == '2') { %>
            <%      order_type = "{% trans '限价卖出'%}" %>
        <%      class_color = "red"%>
        <%  } %>
        <%  if (info.order_type == '11') { %>
            <%      order_type = "{% trans '市价买入'%}" %>
        <%      class_color = "green"%>
        <%  } %>
        <%  if (info.order_type == '12') { %>
            <%      order_type = "{% trans '市价卖出'%}" %>
        <%      class_color = "red"%>
        <%  } %>

        <tr class="<%=class_color%>">
            <td class="<%=class_color%>"><%=create_time%></td>
            <td class="<%=class_color%>"><%=finish_time%></td>
            <td class="<%=class_color%>"><%=order_type%></td>
            <td class="<%=class_color%>"><%=price%></td>
            <td class="<%=class_color%>"><%=count%></td>
            <td class="<%=class_color%>"><%=amount%></td>
        </tr>
        <%}%>
    </tbody>
</table>
</script>
